﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows.Media;


namespace SQLServerOptimizer.PL.WPF
{
    public class CountToForgroundConverter : IValueConverter
    {
        object IValueConverter.Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            {
                if (targetType != typeof(int))

                    throw new InvalidOperationException("The Count must Be an Integer");
                int count = int.Parse(value.ToString());

                return (count == 0 ? Brushes.Red : Brushes.Transparent);
            }
        }

        object IValueConverter.ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    
    
    }
}
